import axios from "axios"

/**
 * 发送Get请求
 * @param url
 * @param params
 */
function sendGetRequest (url:any,params:any) {
    return new Promise(function (resolve, reject){
        axios.get(url,params).then(function (data){
            resolve(data);
        }),function (error:any){
            reject(error);
        }
    })
}

/**
 * 发送Post请求
 * @param url
 * @param params
 */
function sendPostRequest (url:any,params:any) {
    return new Promise(function(resolve, reject){
        axios.post(url,params).then(function (data){
            resolve(data);
        }),function (err:any){
            reject(err);
        }
    })
}
